from djangobb.forums.models     import Forum

def get_next_page(request):
    return request.GET.get('nextpage', '/cms/forums')

def get_forums():
    try:
        forums = Forum.objects.order_by('importance')
    except:
        forums = []

    return forums

def get_uname(request):
    if request.user.is_authenticated():
        uname = request.user.username 
    else:
        uname = 'Anonymous User'
    return uname

def is_staff(request):
    if request.user.is_authenticated() and request.user.is_staff:
        isStaff = True
    else: 
        isStaff = False
    return isStaff
